/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package gui.handlers;

import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

/**
 *
 * @author mazzahaka
 */
public class LaFHandler { //Class for setting Look And Feel Style
    private String os;
    public  LaFHandler() {
      os=System.getProperty("os.name");
        try {
            Linux_Checker();
        } catch (UnsupportedLookAndFeelException ex) {
            System.out.print("Internal Error!");
        }
            Windows_Checker();

    }
    private void Linux_Checker() throws UnsupportedLookAndFeelException{
          if(os.equals("Linux")){
            try {
                UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
            } catch (ClassNotFoundException ex) {
                 System.out.print("Internal Error!");
            } catch (InstantiationException ex) {
                System.out.print("Internal Error!");
            } catch (IllegalAccessException ex) {
                 System.out.print("Internal Error!");
            } catch (UnsupportedLookAndFeelException ex) {
                 System.out.print("Internal Error!");
            }

    }

    }
    private void Windows_Checker(){
          if(os.lastIndexOf("Windows")>-1){
            try {
                 UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
            } catch (ClassNotFoundException ex) {
                 System.out.print("Internal Error!");
            } catch (InstantiationException ex) {
                 System.out.print("Internal Error!");
            } catch (IllegalAccessException ex) {
                 System.out.print("Internal Error!");
            } catch (UnsupportedLookAndFeelException ex) {
                 System.out.print("Internal Error!");
            }

    }
    }
}
